#include <iostream>
#include <vector>
#include <string>
using namespace std;
/*
    英华学校面试题
    IBSN码
*/
int main()
{
    string s;
    cin >> s;
    vector<int> v(10);
    for (int i = 0, j = 0; i < s.length(); i++)
    {
        if (s[i] == 'X')
        {
            v[j++] = 10;
        }
        else if (s[i] != '-')
        {
            v[j++] = s[i] - '0';
        }
    }
    int sum, code;
    for (int i = 0; i < 9; i++)
    {
        sum += ((i + 1) * v[i]);
    }
    code = sum % 11;
    if (code == v[9])
    {
        cout << "Right" << endl;
    }
    else if (code == 10)
        cout << s.substr(0, 12) << "X" << endl;
    else
        cout << s.substr(0, 12) << code << endl;
    return 0;
}